Repository navigation
Plugins-only decoding: drop native parsers, bundle-reference plugins, deletable imports, root-package SDK - #24
Conversation
Full GATT Client (Central) API coverageAudited the app against the 16 members of
This surfaced a real crashWiring return .init(rawValue: 127)!
Also fixed a race: TestsNew Verified on deviceConnected to a peripheral in the simulator: MTU 23 and Signal Strength -60 dBm populate on first load, Refresh no longer crashes, and Disconnect All appears while connected and disappears after tapping it. iOS archive succeeds. |
Four related changes to the plugin system, all iOS-focused.
Verified end to end: clean
swift build+swift test(38 tests),xcodebuild archive(13.wasmplugins bundled), and the app run in the simulator — see the runtime note below.
1. No built-in decoders — plugins only
NativeParsers.swift(the native iBeacon and well-known-characteristic parsers) is deleted, andPluginManagerno longer seeds the registry with them. All decoding now goes through WASM plugins.Coverage is unchanged: the bundled
ibeacon.wasmand the GATT group plugins already cover what thenative parsers did. Tests that used the native parsers as an oracle now assert against hand-computed
values instead.
2. Bundled plugins referenced from the bundle, not copied to Documents
Bundled plugins load directly from
Bundle.moduleand are no longer installed intoDocuments/Plugins. Only user-imported plugins live on disk now.PluginDirectoryloses thebundled-install machinery (install record, first-launch/refresh/idempotence logic) and keeps just
import, list, and delete.
3. Imported plugins can be deleted
PluginStategainsisRemovable(true only for imported plugins). Bundled plugins are read-only inthe app bundle — they can be disabled but not deleted; imported plugins can be deleted, removing them
from
Documents/Plugins. The Plugins screen's swipe-to-delete now applies only to imported rows.4. BLEPluginSDK is a product of the root package
BLEPluginSDKis now a.libraryproduct of the rootbluetooth-explorerpackage, so an externalplugin author can depend on this repository and
import BLEPluginSDK. It is not a dependency of theapp, so the app and the iOS archive never build it. Sources are shared with the standalone
PluginSDK/BLEPluginSDKpackage the in-repo examples use.Caveat, documented in
PluginSDK/README.md: consuming the root package this way does not resolveyet. The app's
AndroidSwiftUIdependency uses a local sub-package, which SwiftPM forbids in abranch-pinned dependency graph, so any transitive consumer of the root package fails to resolve
(the app builds only because it is the root). Until AndroidSwiftUI stops using a local sub-package,
authors build against the standalone
PluginSDK/BLEPluginSDKpackage — which is what the examples do.The product is in place and becomes usable the moment that upstream change lands.
Runtime verification
Removing the native parsers and referencing bundled plugins from the bundle were confirmed together
on device: the simulator's mock iBeacon advertisement still decodes (UUID / major / minor / RSSI) —
which can now only be the bundled
ibeacon.wasmplugin running under the interpreter — whileDocuments/Pluginsis empty, proving nothing was copied out of the bundle.Tests
38 pass (down from 44: the native-parser suite and the two wasm-vs-native parity tests are gone; a
routing-stub test and imported-store import/delete tests are added).